Optimal. Leaf size=135 \[ -\frac {7 \tanh ^{-1}\left (\frac {\sqrt {a} \cos (c+d x)}{\sqrt {a+a \sin (c+d x)}}\right )}{8 \sqrt {a} d}+\frac {9 \cot (c+d x)}{8 d \sqrt {a+a \sin (c+d x)}}+\frac {\cot (c+d x) \csc (c+d x)}{12 d \sqrt {a+a \sin (c+d x)}}-\frac {\cot (c+d x) \csc ^2(c+d x)}{3 d \sqrt {a+a \sin (c+d x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.40, antiderivative size = 135, normalized size of antiderivative = 1.00, number of steps
used = 11, number of rules used = 7, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.304, Rules used = {2797, 2728,
212, 3123, 3063, 3064, 2852} \begin {gather*} \frac {9 \cot (c+d x)}{8 d \sqrt {a \sin (c+d x)+a}}-\frac {7 \tanh ^{-1}\left (\frac {\sqrt {a} \cos (c+d x)}{\sqrt {a \sin (c+d x)+a}}\right )}{8 \sqrt {a} d}-\frac {\cot (c+d x) \csc ^2(c+d x)}{3 d \sqrt {a \sin (c+d x)+a}}+\frac {\cot (c+d x) \csc (c+d x)}{12 d \sqrt {a \sin (c+d x)+a}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 2728
Rule 2797
Rule 2852
Rule 3063
Rule 3064
Rule 3123
Rubi steps
\begin {align*} \int \frac {\cot ^4(c+d x)}{\sqrt {a+a \sin (c+d x)}} \, dx &=\int \frac {1}{\sqrt {a+a \sin (c+d x)}} \, dx+\int \frac {\csc ^4(c+d x) \left (1-2 \sin ^2(c+d x)\right )}{\sqrt {a+a \sin (c+d x)}} \, dx\\ &=-\frac {\cot (c+d x) \csc ^2(c+d x)}{3 d \sqrt {a+a \sin (c+d x)}}+\frac {\int \frac {\csc ^3(c+d x) \left (-\frac {a}{2}-\frac {7}{2} a \sin (c+d x)\right )}{\sqrt {a+a \sin (c+d x)}} \, dx}{3 a}-\frac {2 \text {Subst}\left (\int \frac {1}{2 a-x^2} \, dx,x,\frac {a \cos (c+d x)}{\sqrt {a+a \sin (c+d x)}}\right )}{d}\\ &=-\frac {\sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {a} \cos (c+d x)}{\sqrt {2} \sqrt {a+a \sin (c+d x)}}\right )}{\sqrt {a} d}+\frac {\cot (c+d x) \csc (c+d x)}{12 d \sqrt {a+a \sin (c+d x)}}-\frac {\cot (c+d x) \csc ^2(c+d x)}{3 d \sqrt {a+a \sin (c+d x)}}+\frac {\int \frac {\csc ^2(c+d x) \left (-\frac {27 a^2}{4}-\frac {3}{4} a^2 \sin (c+d x)\right )}{\sqrt {a+a \sin (c+d x)}} \, dx}{6 a^2}\\ &=-\frac {\sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {a} \cos (c+d x)}{\sqrt {2} \sqrt {a+a \sin (c+d x)}}\right )}{\sqrt {a} d}+\frac {9 \cot (c+d x)}{8 d \sqrt {a+a \sin (c+d x)}}+\frac {\cot (c+d x) \csc (c+d x)}{12 d \sqrt {a+a \sin (c+d x)}}-\frac {\cot (c+d x) \csc ^2(c+d x)}{3 d \sqrt {a+a \sin (c+d x)}}+\frac {\int \frac {\csc (c+d x) \left (\frac {21 a^3}{8}-\frac {27}{8} a^3 \sin (c+d x)\right )}{\sqrt {a+a \sin (c+d x)}} \, dx}{6 a^3}\\ &=-\frac {\sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {a} \cos (c+d x)}{\sqrt {2} \sqrt {a+a \sin (c+d x)}}\right )}{\sqrt {a} d}+\frac {9 \cot (c+d x)}{8 d \sqrt {a+a \sin (c+d x)}}+\frac {\cot (c+d x) \csc (c+d x)}{12 d \sqrt {a+a \sin (c+d x)}}-\frac {\cot (c+d x) \csc ^2(c+d x)}{3 d \sqrt {a+a \sin (c+d x)}}+\frac {7 \int \csc (c+d x) \sqrt {a+a \sin (c+d x)} \, dx}{16 a}-\int \frac {1}{\sqrt {a+a \sin (c+d x)}} \, dx\\ &=-\frac {\sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {a} \cos (c+d x)}{\sqrt {2} \sqrt {a+a \sin (c+d x)}}\right )}{\sqrt {a} d}+\frac {9 \cot (c+d x)}{8 d \sqrt {a+a \sin (c+d x)}}+\frac {\cot (c+d x) \csc (c+d x)}{12 d \sqrt {a+a \sin (c+d x)}}-\frac {\cot (c+d x) \csc ^2(c+d x)}{3 d \sqrt {a+a \sin (c+d x)}}-\frac {7 \text {Subst}\left (\int \frac {1}{a-x^2} \, dx,x,\frac {a \cos (c+d x)}{\sqrt {a+a \sin (c+d x)}}\right )}{8 d}+\frac {2 \text {Subst}\left (\int \frac {1}{2 a-x^2} \, dx,x,\frac {a \cos (c+d x)}{\sqrt {a+a \sin (c+d x)}}\right )}{d}\\ &=-\frac {7 \tanh ^{-1}\left (\frac {\sqrt {a} \cos (c+d x)}{\sqrt {a+a \sin (c+d x)}}\right )}{8 \sqrt {a} d}+\frac {9 \cot (c+d x)}{8 d \sqrt {a+a \sin (c+d x)}}+\frac {\cot (c+d x) \csc (c+d x)}{12 d \sqrt {a+a \sin (c+d x)}}-\frac {\cot (c+d x) \csc ^2(c+d x)}{3 d \sqrt {a+a \sin (c+d x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(292\) vs. \(2(135)=270\).
time = 0.45, size = 292, normalized size = 2.16 \begin {gather*} \frac {\csc ^9\left (\frac {1}{2} (c+d x)\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right ) \left (36 \cos \left (\frac {1}{2} (c+d x)\right )-46 \cos \left (\frac {3}{2} (c+d x)\right )-54 \cos \left (\frac {5}{2} (c+d x)\right )-36 \sin \left (\frac {1}{2} (c+d x)\right )-63 \log \left (1+\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (c+d x)+63 \log \left (1-\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (c+d x)-46 \sin \left (\frac {3}{2} (c+d x)\right )+54 \sin \left (\frac {5}{2} (c+d x)\right )+21 \log \left (1+\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (3 (c+d x))-21 \log \left (1-\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (3 (c+d x))\right )}{24 d \left (\csc ^2\left (\frac {1}{4} (c+d x)\right )-\sec ^2\left (\frac {1}{4} (c+d x)\right )\right )^3 \sqrt {a (1+\sin (c+d x))}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 5.20, size = 144, normalized size = 1.07
method | result | size |
default | \(\frac {\left (1+\sin \left (d x +c \right )\right ) \sqrt {-a \left (\sin \left (d x +c \right )-1\right )}\, \left (-21 \arctanh \left (\frac {\sqrt {-a \left (\sin \left (d x +c \right )-1\right )}}{\sqrt {a}}\right ) a^{3} \left (\sin ^{3}\left (d x +c \right )\right )+27 \left (-a \left (\sin \left (d x +c \right )-1\right )\right )^{\frac {5}{2}} \sqrt {a}-56 \left (-a \left (\sin \left (d x +c \right )-1\right )\right )^{\frac {3}{2}} a^{\frac {3}{2}}+21 \sqrt {-a \left (\sin \left (d x +c \right )-1\right )}\, a^{\frac {5}{2}}\right )}{24 a^{\frac {7}{2}} \sin \left (d x +c \right )^{3} \cos \left (d x +c \right ) \sqrt {a +a \sin \left (d x +c \right )}\, d}\) | \(144\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 369 vs.
\(2 (115) = 230\).
time = 0.36, size = 369, normalized size = 2.73 \begin {gather*} \frac {21 \, {\left (\cos \left (d x + c\right )^{4} - 2 \, \cos \left (d x + c\right )^{2} - {\left (\cos \left (d x + c\right )^{3} + \cos \left (d x + c\right )^{2} - \cos \left (d x + c\right ) - 1\right )} \sin \left (d x + c\right ) + 1\right )} \sqrt {a} \log \left (\frac {a \cos \left (d x + c\right )^{3} - 7 \, a \cos \left (d x + c\right )^{2} - 4 \, {\left (\cos \left (d x + c\right )^{2} + {\left (\cos \left (d x + c\right ) + 3\right )} \sin \left (d x + c\right ) - 2 \, \cos \left (d x + c\right ) - 3\right )} \sqrt {a \sin \left (d x + c\right ) + a} \sqrt {a} - 9 \, a \cos \left (d x + c\right ) + {\left (a \cos \left (d x + c\right )^{2} + 8 \, a \cos \left (d x + c\right ) - a\right )} \sin \left (d x + c\right ) - a}{\cos \left (d x + c\right )^{3} + \cos \left (d x + c\right )^{2} + {\left (\cos \left (d x + c\right )^{2} - 1\right )} \sin \left (d x + c\right ) - \cos \left (d x + c\right ) - 1}\right ) - 4 \, {\left (27 \, \cos \left (d x + c\right )^{3} + 25 \, \cos \left (d x + c\right )^{2} - {\left (27 \, \cos \left (d x + c\right )^{2} + 2 \, \cos \left (d x + c\right ) - 17\right )} \sin \left (d x + c\right ) - 19 \, \cos \left (d x + c\right ) - 17\right )} \sqrt {a \sin \left (d x + c\right ) + a}}{96 \, {\left (a d \cos \left (d x + c\right )^{4} - 2 \, a d \cos \left (d x + c\right )^{2} + a d - {\left (a d \cos \left (d x + c\right )^{3} + a d \cos \left (d x + c\right )^{2} - a d \cos \left (d x + c\right ) - a d\right )} \sin \left (d x + c\right )\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: SystemError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\cos \left (c+d\,x\right )}^4}{{\sin \left (c+d\,x\right )}^4\,\sqrt {a+a\,\sin \left (c+d\,x\right )}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________